#include "complex.h"
#include<iostream>
using namespace std;
complex::complex(){}

complex::complex(double real, double image)
{
	_real = real;
	_image = image;
}

complex::~complex(){}

complex& complex::operator=(complex& c)
{

	_real = c._real;
	_image = c._image;
	return *this;
}

void complex::setreal(double real)
{
	this->_real = real;
}

double complex::getreal()
{
	return _real;
}

void complex::setimage(double image)
{
	this->_image = image;
}

double complex::getimage()
{
	return _image;
}

complex& complex::operator+=(complex& c)
{

	_real += c._real;
	_image += c._image;
	return *this;
}

complex complex::operator+(complex& c)
{
	return complex(_real + c._real, _image + c._image);

}

complex complex::operator==(complex& c)
{
	return ((_real==c._real)&&(_image==c._image));
}

ostream& operator<<(ostream& os, complex& c)
{
	
	os << "real" << c._real <<"image" << c._image << endl;
	return os;
}
istream& operator>>(istream& is, complex& c)
{
	is >> c._real >> c._image;
	return is;
}
